local danchong = fk.CreateSkill{
  name = "wk_heg__danchong",
}

Fk:loadTranslationTable{
  ["wk_heg__danchong"] = "丹宠",
  [":wk_heg__danchong"] = "当你获得红桃牌后，你可以明置之并摸一张牌；其他角色对你使用的红桃牌伤害和回复值+1 。",
}

local HG = require "packages/new_heg_diy_my/util"
local H = require "packages/ol_hegemony/util"
local U = require "packages/utility/utility"

danchong:addEffect(fk.AfterCardsMove, {
  anim_type = "drawcard",
  events = {fk.AfterCardsMove},
  can_trigger = function (self, event, target, player, data)
    if player:hasSkill(self) then
      local cards = {}
      for _, move in ipairs(data) do
        if move.to == player and move.toArea == Card.PlayerHand then
          for _, info in ipairs(move.moveInfo) do
            local c = Fk:getCardById(info.cardId)
            if c.suit == Card.Heart then
              table.insert(cards, c.id)
            end
          end
        end
      end
      if #cards == 0 then return end
      cards = player.room.logic:moveCardsHoldingAreaCheck(cards)
      cards = table.filter(cards, function (id)
        return Fk:getCardById(id):getMark(MarkEnum.ShownCards) == 0 end)
      if #cards > 0 then
        event:setCostData(self, cards)
        return true
      end
    end
  end,
  on_use = function (self, event, target, player, data)
    HG.showCards(player, event:getCostData(self))
    if player.dead then return end

    player:drawCards(1, ceju.name)
  end,
})

danchong:addEffect(fk.CardEffecting, {
  anim_type = "control",
  can_trigger = function (self, event, target, player, data)
    return player:hasShownSkill(self) and player == target and data.card.suit == Card.Heart and data.from ~= player
  end,
  on_cost = Util.TrueFunc,
  on_use = function (self, event, target, player, data)
    data.additionalDamage = (data.additionalDamage or 0) + 1
    data.additionalRecover = (data.additionalRecover or 0) + 1
  end,
})

return danchong